<?php
if (isset($_FILES['sendfile'])){
	$errors = array();
	print_r($_FILES['sendfile']);
	$allowed_ext = array('jpg', 'jpeg', 'png', 'gif');
	
	$file_name = $_FILES['sendfile']['name'];
	$file_ext = explode('.', $file_name);
	
	print_r($file_ext);
	
	$file_size = $_FILES['sendfile']['size'];
	$file_tmp = $_FILES['sendfile']['tmp_name'];
	
	$uploads_dir = '/uploads';  
	chmod('C:\wamp\www\uploads', 0777);
		$tmp_name = $_FILES['sendfile']["tmp_name"];
        $name = $_POST['filename'];
        move_uploaded_file($tmp_name,"/usr/local/apache/htdocs/uploads/". $name);
		//move_uploaded_file($tmp_name,"./uploads/". $name);
	// $files = $_FILES['files']['tmp_name'];
	 
	
}
?>

<html>
<body>
<form method="post" enctype="multipart/form-data" action="">
 Enter file: <input type="file" name="sendfile" size="40" id="sendfile">
 Enter file name: <input type="text" name="filename" size="30">
 <input type="submit" value="send" name="submit">
</body>
</html> 
